package com.atguigu.spzx.manager.controller.system;

import com.atguigu.spzx.manager.service.system.SysUserRoleService;
import com.atguigu.spzx.model.dto.system.AssginRoleDto;
import com.atguigu.spzx.model.vo.common.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mahone
 */
@RestController
@RequestMapping("/admin/system/sysUserRole")
public class SysUserRoleController {

    @Autowired
    private SysUserRoleService sysUserRoleService;

    /**
     * 为用户分配角色
     * @param assginRoleDto
     * @return
     */
    @PostMapping("/doAssignRoleToUser")
    public Result doAssginRoleIdToUser(@RequestBody AssginRoleDto assginRoleDto){
            sysUserRoleService.doAssginRoleIdToUser(assginRoleDto);
            return Result.ok();
    }
}
